package com.ssy.lingxi.pay.api.feign;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.pay.api.model.vo.request.ccb.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.validation.Valid;

/**
 * @Description: 建行支付内部接口
 * @Author: HuangJieZhou
 * @Date: 2021/12/20 15:46
 * @Version: 2.0.0
 **/
@FeignClient(value = "pay-service")
public interface ICcbPayFeign {

    /**
     * 建行B2B普通商户支付
     * @param ccbPayVo 接口请求参数
     * @return 跳转建行html页面
     */
    @RequestMapping(value = "/pay/ccb/b2bPay", method = RequestMethod.POST)
    Wrapper<String> b2bPay(@RequestBody @Valid CcbB2bPayVo ccbPayVo);

    /**
     * 建行B2B订单支付状态查询
     * @param ccbAccountQueryVo 请求参数
     * @return 订单状态，枚举类型: CcbB2bPayResultEnum
     */
    @RequestMapping(value = "/pay/ccb/b2bPayStatusQuery", method = RequestMethod.POST)
    Wrapper<String> b2bPayStatusQuery(@RequestBody @Valid CcbB2bPayQueryVo ccbAccountQueryVo);

    /**
     * 建行B2B商户退款
     * @param refundVO 请求参数
     * @return 成功返回true, 失败直接抛异常
     */
    @RequestMapping(value = "/pay/ccb/b2bRefund", method = RequestMethod.POST)
    Wrapper<Boolean> b2bRefund(@RequestBody @Valid B2bRefundVO refundVO);

    /**
     * 建行B2B退款查询
     * @param refundVO 请求参数
     * @return 订单状态，枚举类型: CcbB2bPayRefundEnum
     */
    @RequestMapping(value = "/pay/ccb/b2bRefundQuery", method = RequestMethod.POST)
    Wrapper<String> b2bRefundQuery(@RequestBody @Valid B2bRefundQueryVO refundVO);

    /**
     * 建行数字人民币支付
     * @param ccbDigitalPayVo 接口请求参数
     * @return payType支付类型-1:返回二维码路径; 2-返回h5页面
     */
    @RequestMapping(value = "/pay/ccb/digitalPay", method = RequestMethod.POST)
    Wrapper<String> digitalPay(@RequestBody @Valid CcbDigitalPayVo ccbDigitalPayVo);

    /**
     * 建行数字人民币退款
     * @param digitalRefundVO 接口请求参数
     * @return 成功返回true, 失败直接抛异常
     */
    @RequestMapping(value = "/pay/ccb/digitalRefund", method = RequestMethod.POST)
    Wrapper<Boolean> digitalRefund(@RequestBody @Valid DigitalRefundVO digitalRefundVO);
}
